#include<cstdio>
#include<algorithm>
using namespace std;
typedef long long ll;
int n, L, r, t;
const int maxn = 2000+6;
int pic[maxn][maxn];
int cnt = 0;
int main() {
  scanf("%d%d%d%d", &n, &L, &r, &t);
  for(int i=1; i<=n; ++i) {
    for(int j=1; j<=n; ++j) {
      int num;
      scanf("%d", &num);
      pic[i][j] = num - t;
    }
  }
  for(int i=1; i<=n; ++i) {
    for(int j=1; j<=n; ++j) {
      pic[i][j] += pic[i-1][j] + pic[i][j-1] - pic[i-1][j-1];
    }
  }

  for(int i=1; i<=n; ++i) {
    for(int j=1; j<=n; ++j) {
      int mini = max(0, i-r-1), minj = max(0, j-r-1), maxi = min(n, i+r), maxj = min(n, j+r);
      int sum = pic[maxi][maxj] - pic[mini][maxj] - pic[maxi][minj] + pic[mini][minj];
      if(sum <= 0) cnt++;
    }
  }

  printf("%d\n", cnt);
}
